#ifndef ROUTEITEMWIDGET_H
#define ROUTEITEMWIDGET_H

#include <QListWidgetItem>
#include <QWidget>

namespace Ui {
class RouteItemWidget;
}

class RouteItemWidget : public QWidget
{
    Q_OBJECT

public:
    explicit RouteItemWidget(QWidget *parent = nullptr);
    ~RouteItemWidget();

    static RouteItemWidget* make(QString &route);
    void connectSignals();

    QString scripts();
    QString script_add();
    QString script_del();

    QString route_now();

    QString route() const;
    void setStrikeOut(bool is);

signals:
    void onDelete(RouteItemWidget*);
    void onRestoreDelete(RouteItemWidget*);
    void applySignal(RouteItemWidget*);

private slots:
    void on_RouteItemWidget_customContextMenuRequested(const QPoint &pos);

    void on_action_delete_triggered();
    void on_action_restore_delete_triggered();

    void on_action_modify_triggered();

    void on_action_apply_triggered();

    void slot_spinBox_textChanged(QString arg1);

private:
    Ui::RouteItemWidget *ui;
    QString m_route;

    //
    bool m_route_modified;
    bool m_route_deleted;
    bool m_route_contains_metric;
};

#endif // ROUTEITEMWIDGET_H
